import common from '../vendor/common'
import '../scss/serve_index.scss'
const Vue = common.Vue
const mui = common.mui
let serveListlVue = {}
var webview_ServeDetail = null // 服务详情页面 预加载
import { 
    getServerAllList,
    getIndexServerShow
  } from '../vendor/api'
try{
    mui.plusReady(function(){
        var titleNView = { //详情页原生导航配置
            backgroundColor: '#f7f7f7', //导航栏背景色
            titleText: '', //导航栏标题
            titleColor: '#000000', //文字颜色
            type: 'default', //透明渐变样式
            autoBackButton: true, //自动绘制返回箭头
            splitLine: { //底部分割线
                color: '#efefef'
            }
        }
        webview_ServeDetail = plus.webview.getWebviewById('serve_detail.html')
        serveListlVue = new Vue({ // 精品推荐列表vue实例
            el: '#serveListlVue',
            data: {
              list: []
            },
            methods: {
              toBuidingDetail: function(id) {
                skipBuildingShow(id)
              },
               // 服务列表跳转方法
              skipServerList: function(data) {
                mui.fire(webview_ServeDetail, 'upData', data);
                //更改详情页原生导航条信息
                titleNView.titleText = data.name;
                webview_ServeDetail.setStyle({
                  "titleNView": titleNView
                });
                setTimeout(function () {
                  webview_ServeDetail.show('slide-in-right', 300);
                }, 150);
              },
            },
            
        })
        getServerAllList().then(res => {
            if (res.success) {
                serveListlVue.list = res.data
            }
        })
    });
} catch(e){
    console.log('house_detail出错了')
}

